package pe.edu.upc.dew.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import pe.edu.upc.dew.model.Merchandizing;
import pe.edu.upc.dew.service.MerchandizingService;

@Controller
@RequestMapping("/merchandizing.htm")
public class MerchandizingController {
    @Autowired
    private MerchandizingService merchandizingService;
    
    @RequestMapping(method = RequestMethod.GET)
    public @ModelAttribute("merchandizings")
    List<Merchandizing> setupForm(@RequestParam("id") String id)
    {
        List<Merchandizing> merchandizings = merchandizingService.obtenerMerchandizingPorPelicula(id);
        return merchandizings;

    }
}
